/*
 * Copyright 2010 Biz-e (info@biz-e.nl)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package nl.biz_e.acl.client;

import java.util.List;

import nl.biz_e.acl.shared.model.User;
import nl.biz_e.acl.shared.model.UserGroup;

import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * Asynchrone counterpart for the {@link UserService} interface
 * 
 * @author Joost A. Bloemsma
 * 
 */
public interface UserServiceAsync {
    /**
     * @see UserService#saveUser(User)
     * @param user
     * @param async
     */
    public void saveUser(User user, AsyncCallback<User> async);

    /**
     * @see UserService#deleteUser(User)
     * @param user
     * @param async
     */
    public void deleteUser(User user, AsyncCallback<Void> async);

    /**
     * @see UserService#saveUserGroup(UserGroup)
     * @param group
     * @param async
     */
    public void saveUserGroup(UserGroup group, AsyncCallback<UserGroup> async);

    /**
     * @see UserService#deleteUserGroup(UserGroup)
     * @param group
     * @param async
     */
    public void deleteUserGroup(UserGroup group, AsyncCallback<Void> async);

    /**
     * @see UserService#setMembership(User, UserGroup)
     * @param user
     * @param group
     * @param async
     */
    public void setMembership(User user, UserGroup group,
            AsyncCallback<Boolean> async);

    /**
     * @see UserService#deleteMembership(User, UserGroup)
     * @param user
     * @param group
     * @param async
     */
    public void deleteMembership(User user, UserGroup group,
            AsyncCallback<Void> async);

    /**
     * @see UserService#getGroupMembers(UserGroup)
     * @param group
     * @param async
     */
    public void getGroupMembers(UserGroup group, AsyncCallback<List<User>> async);

    /**
     * @see UserService#getMemberships(User)
     * @param user
     * @param async
     */
    public void getMemberships(User user, AsyncCallback<List<UserGroup>> async);

}
